[IA64] Use vcpu_get_psr instead of vcpu_get_ipsr_int_state.
authorAlex Williamson <alex.williamson@hp.com>
Mon, 4 Jun 2007 20:16:21 +0000 (14:16 -0600)
committerAlex Williamson <alex.williamson@hp.com>
Mon, 4 Jun 2007 20:16:21 +0000 (14:16 -0600)
Signed-off-by: Tristan Gingold <tgingold@free.fr>
xen/arch/ia64/xen/faults.c
xen/arch/ia64/xen/vcpu.c
xen/include/asm-ia64/vcpu.h

index cf50f944248dbd07ed43753ae76a47841753eedf..0d04b21e9b516b73bb9bb3235ea1f352d989a28f 100644 (file)
@@ -84,7 +84,7 @@ static void reflect_interruption(unsigned long isr, struct pt_regs *regs,
                check_bad_nested_interruption(isr, regs, vector);
        PSCB(v, unat) = regs->ar_unat;  // not sure if this is really needed?
        PSCB(v, precover_ifs) = regs->cr_ifs;
-       PSCB(v, ipsr) = vcpu_get_ipsr_int_state(v, regs->cr_ipsr);
+       PSCB(v, ipsr) = vcpu_get_psr(v);
        vcpu_bsw0(v);
        PSCB(v, isr) = isr;
        PSCB(v, iip) = regs->cr_iip;
@@ -129,7 +129,7 @@ void reflect_event(void)
                       regs->cr_ipsr, regs->cr_iip, isr, PSCB(v, iip));
        PSCB(v, unat) = regs->ar_unat;  // not sure if this is really needed?
        PSCB(v, precover_ifs) = regs->cr_ifs;
-       PSCB(v, ipsr) = vcpu_get_ipsr_int_state(v, regs->cr_ipsr);
+       PSCB(v, ipsr) = vcpu_get_psr(v);
        vcpu_bsw0(v);
        PSCB(v, isr) = isr;
        PSCB(v, iip) = regs->cr_iip;
index 6a3b6c9aa456bfabf7c0895a10f8b3179ea33933..4a6227515f461cf7e6e0786e9acca7d39f935ee0 100644 (file)
@@ -539,6 +539,8 @@ u64 vcpu_get_psr(VCPU * vcpu)
        /* Fool cpl.  */
        if (ipsr.ia64_psr.cpl < 3)
                newpsr.ia64_psr.cpl = 0;
+       else
+               newpsr.ia64_psr.cpl = 3;
 
        newpsr.ia64_psr.bn = PSCB(vcpu, banknum);
        
@@ -552,30 +554,6 @@ IA64FAULT vcpu_get_psr_masked(VCPU * vcpu, u64 * pval)
        return IA64_NO_FAULT;
 }
 
-u64 vcpu_get_ipsr_int_state(VCPU * vcpu, u64 prevpsr)
-{
-       u64 dcr = PSCB(vcpu, dcr);
-       PSR psr;
-
-       //printk("*** vcpu_get_ipsr_int_state (0x%016lx)...\n",prevpsr);
-       psr.i64 = prevpsr;
-       psr.ia64_psr.pp = 0;
-       if (dcr & IA64_DCR_PP)
-               psr.ia64_psr.pp = 1;
-       psr.ia64_psr.ic = PSCB(vcpu, interrupt_collection_enabled);
-       psr.ia64_psr.i = !vcpu->vcpu_info->evtchn_upcall_mask;
-       psr.ia64_psr.bn = PSCB(vcpu, banknum);
-       psr.ia64_psr.dfh = PSCB(vcpu, vpsr_dfh);
-       psr.ia64_psr.dt = 1;
-       psr.ia64_psr.it = 1;
-       psr.ia64_psr.rt = 1;
-       if (psr.ia64_psr.cpl == 2)
-               psr.ia64_psr.cpl = 0;   // !!!! fool domain
-       // psr.pk = 1;
-       //printk("returns 0x%016lx...\n",psr.i64);
-       return psr.i64;
-}
-
 BOOLEAN vcpu_get_psr_ic(VCPU * vcpu)
 {
        return !!PSCB(vcpu, interrupt_collection_enabled);
index caf2be867d11bb84c8900972ee85399066c71090..04aeac96c5c4e5c5a07b95ee871301ec6998d16b 100644 (file)
@@ -41,7 +41,6 @@ extern IA64FAULT vcpu_set_ar(VCPU * vcpu, u64 reg, u64 val);
 extern IA64FAULT vcpu_get_ar(VCPU * vcpu, u64 reg, u64 * val);
 /* psr */
 extern BOOLEAN vcpu_get_psr_ic(VCPU * vcpu);
-extern u64 vcpu_get_ipsr_int_state(VCPU * vcpu, u64 prevpsr);
 extern u64 vcpu_get_psr(VCPU * vcpu);
 extern IA64FAULT vcpu_get_psr_masked(VCPU * vcpu, u64 * pval);
 extern IA64FAULT vcpu_reset_psr_sm(VCPU * vcpu, u64 imm);